module.exports = {
    chainWebpack: (config) => {
        config
            .plugin('define')
            .tap((args) => {
                args[0]['process.env'].BUILD_TIME = JSON.stringify(new Date().toString())
                return args
            })
            .end()
        // config.module.rule('markdown').test(/\.md$/).use('html-loader').loader('markdown-loader').end()
    },
    css: {
        loaderOptions: {
          less: {
            // 配置主题
            modifyVars: {
              'primary-color': '#116EBE', // UI框架的主要颜色
              'border-radius-base': '4px'
            },
            javascriptEnabled: true
          }
        }
      },

    configureWebpack: {
        module: {
            rules: [
                {
                    test: /\.md$/,
                    use: [
                        {
                            loader: 'html-loader',
                        },
                        {
                            loader: 'markdown-loader',
                            options: {
                                /* your options here */
                            },
                        },
                    ],
                },
                // {
                //     test: /\.html$/i,
                //     loader: 'html-loader',
                // },
            ],
        },
    },

    devServer: { // 环境配置
        host: '0.0.0.0',
        // public: '192.168.1.113:8080',// 开发过程中填写本机ip（或省略），部署后填写服务器ip
        port: '8080',
        https: false,
        disableHostCheck: true,
        open: false // 配置自动启动浏览器
    },
  

    /* 解决"Component provided template option but runtime compilation is not supported
    in this build of Vue. Configure your bundler to alias "vue" to "vue/dist/vue.esm-bundler.js" */
    runtimeCompiler: true,

    productionSourceMap: false,
}